# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jaewon

import datetime

from coin.exchange.binance.kr_rest.currency import BinanceCurrency
from coin.exchange.binance.order_gateway import BinanceOrderGateway
from coin.strategy.mm.subscription import SubscriptionRequest
from coin.strategy.mm.base.order_subsystem import BaseOrderSubsystem


class BinanceOrderSubsystem(BaseOrderSubsystem):
  OrderSubReq = SubscriptionRequest('Spot', 'Binance', None)
  OrderGateway = BinanceOrderGateway
  _delay_notify_order_gateway_reset = datetime.timedelta(seconds=5)

  def __init__(self, *args, subscribe_bnb=True, **kwargs):
    super().__init__(*args, **kwargs)
    if subscribe_bnb:
      self._currencies.append(BinanceCurrency.FromStrCurrency('BNB'))
